// 弹出冻结对话框事例
<template>
  <el-dialog
    title=""
    :visible.sync="centerDialogVisible"
    width="20%"
    center
  >
    <div class="header">
      <div class="top">
        <span>解除冻结</span>
      </div>
      <div class="center">
        <span>解除冻结后可使用积分、余额</span>
      </div>
      <div class="bottom">
        <div class="btn">
          <button class="btn_determine" @click="determine">确认</button>
          <button class="btn_cancel" @click="cancel">取消</button>
        </div>
      </div>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "Popup",
  props:[
    'frozen_index',
    'user_ids'
  ],
  data() {
    return {
      centerDialogVisible: false,
      user_id:this.user_ids,
    };
  },
  methods: {
    // 确定解冻
    determine() {
      this.$axios({
        method: 'post',
        url:'/user/user_frozen',
        params:{
          id:this.user_id,
          style:2,
          dpid:1,
        }
      })
      .then((res) => {
        console.log(res,"解除冻结客户")
        if(res.data.status==1){
          this.$message({
            type: "success",
            message: "解除冻结失败！",
          });
        }else{
          this.$message({
            type: "success",
            message: "所选用户已解除冻结！",
          });
          // this.$emit('frozenChange',this.frozen_index); // 调用父组件改变冻结状态
        }
        
      })
      this.centerDialogVisible = false;
    },

    // 取消冻结
    cancel() {
      this.centerDialogVisible = false;
    },
  },
};
</script>
<style scoped>
.header {
  margin: 0 auto;
  padding: 0;
  border-radius: 10px;
}
.top {
  margin: 21px auto;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #484848;
}
.center {
  margin: 0 auto;
  margin-bottom: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  color: #484848;
}
.bottom {
  margin: 0 auto;
  text-align: center;
}
.btn {
  display: inherit;
  margin: 0 auto;
}
.btn button {
  cursor: pointer;
}
span {
  text-align: center;
}
</style>